package cn.gson.work.model.pojos;

import javax.persistence.*;
import java.util.Collection;
import java.util.Objects;

@Entity
public class Profitcat {
    private long pfcId;
    private String pfcName;
    private String pfcForm;
    private Collection<Profit> profits;

    @Id
    @Column(name = "PFC_ID")
    public long getPfcId() {
        return pfcId;
    }

    public void setPfcId(long pfcId) {
        this.pfcId = pfcId;
    }

    @Basic
    @Column(name = "PFC_NAME")
    public String getPfcName() {
        return pfcName;
    }

    public void setPfcName(String pfcName) {
        this.pfcName = pfcName;
    }

    @Basic
    @Column(name = "PFC_FORM")
    public String getPfcForm() {
        return pfcForm;
    }

    public void setPfcForm(String pfcForm) {
        this.pfcForm = pfcForm;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Profitcat profitcat = (Profitcat) o;
        return pfcId == profitcat.pfcId &&
                Objects.equals(pfcName, profitcat.pfcName) &&
                Objects.equals(pfcForm, profitcat.pfcForm);
    }
    @OneToMany(mappedBy = "profitcat")
    public Collection<Profit> getProfits() {
        return profits;
    }

    public void setProfits(Collection<Profit> profits) {
        this.profits = profits;
    }





    @Override
    public int hashCode() {
        return Objects.hash(pfcId, pfcName, pfcForm);
    }


}
